import static org.junit.Assert.*;
import java.awt.BorderLayout;
import java.io.File;
import javax.swing.JFrame;
import javax.swing.JMenuBar;


public class CocoaTester {
	private final static JMenuBar menuBar = new JMenuBar();
	@org.junit.Test
	public void test() {
		//first test
		String fileName = "test";
		File file = new File (System.getProperty("user.dir") + "\\" + fileName + ".ics");
		
		//delete file if it exists
		if(file.exists()) {
			org.junit.Assert.assertTrue(file.delete());
		}
		
		FileMaker test = new FileMaker();
		test.set_attribute("VERSION","1.0","calendar");
		test.set_attribute("CALSCALE","GREGORIAN","calendar");
		test.set_attribute("SUMMARY","Exam Study");
		test.set_attribute("DESCRIPTION","study for exam information and details");
		test.set_attribute("LOCATION","Hamilton Library");
		
		//file generated
		org.junit.Assert.assertTrue(test.generate(fileName));
		
		//file created
		org.junit.Assert.assertTrue(file.exists());
		
			
		//second test
		JFrame window = new JFrame();
	    window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	    window.setTitle("t3@m C0cO@ LOL");
	    ICS314CalenderGUI panel = new ICS314CalenderGUI();
	    window.add(panel);
	    window.pack();
	    window.setVisible(true);
	    panel.setLayout(new BorderLayout());
	    panel.add(menuBar, BorderLayout.NORTH);
		
	    org.junit.Assert.assertTrue(panel.getInitialize());  
	       
	}
}

